package com.forum.mapper.talk;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.forum.pojo.talk.TalkList;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author Tsing
 * 聊吧Mapper
 */
public interface TalkListMapper extends BaseMapper<TalkList> {

    /**
     * 获取热门论坛 按照帖子数量进行获取
     * @return List
     * **/
    @Select("select  id, index_image, manager_id, summary, create_time, talk_name from talk_list where id in (select talk_id from talk_posts group by talk_id) order by(id) desc limit 10")
    List<TalkList> getHoTalk();
}
